using System;
using System.Collections.Generic;
using System.Text;
using WozLib.UI.Ink.SketchCommands;
using System.Xml.Serialization;

namespace WozLib.WozCommands
{
  public class ClientWozCommand : WozCommand
  {
    // Serves as a container for one or more client commands performed by the wizard for 
    // undo/redo/recording on the wizard end of things. 
    
    // If deserializing this command: the WozClientCommandReferences for the 
    // WozClientCommands can be set by setting the WozServerCommandReferences

    [XmlElement("WozClientCommands")]
    public SketchCommandCollection WozClientCommands
    {
      get
      {
        return _WozClientCommands;
      }
      set
      {
        _WozClientCommands = value;
      }
    } private SketchCommandCollection _WozClientCommands;

    public ClientWozCommand()
    {
      SketchCommandCollection _WozClientCommands = new SketchCommandCollection();
    }

    public ClientWozCommand(SketchCommand wozClientCommand)
    {
      WozClientCommands = new SketchCommandCollection(wozClientCommand);
    }

    public ClientWozCommand(SketchCommandCollection wozClientCommands)
    {
      WozClientCommands = wozClientCommands;
    }

    public override void Undo()
    {
      // make sure WozClientCommandReferences are set correctly from WozServerCommandReferences

      // todo
      //InkCanvas
      //WozObjectRegistry

      WozClientCommands.UndoAll();
    }

    public override void Redo()
    {
      // make sure WozClientCommandReferences are set correctly from WozServerCommandReferences

      // todo
      //InkCanvas
      //WozObjectRegistry

      WozClientCommands.RedoAll();
    }
  }
}
